<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.cookie.js"></script>
<script type="text/javascript">
var links = 0;
	$("document").ready(function(){
		$(".project").click(function(){
				alert("click");
			});


			//setTimeout(callfun,5000);
			function callfun(){
				
					$("#body").append('<ifrmae></iframe>');
				}
			$("#b2").click(function(){

				$.ajax({
						url		:"index1.jsp",
						cache	: false
					}).done(function(data){
							alert(data);
							var array = data.split(',');
							links = array.length;
							for(var i = 0;i<array.length;i++)
							{
								$("body").append('<iframe src='+array[i]+' id="iframe'+i+'" onload="fun()"></iframe>');
							}
							 
						});
				//var v = 'http://www.w3schools.com/';
				//$("body").append('<iframe src='+v+' onload="fun()"></iframe>');
				});
			alert($.cookie('vasu'));
			$("#b1").click(function(){
					$.ajax({
							url:"index.html",
							cache : false
						}).done(function(data){
								alert("In done");
								$("#body1").attr('src',"http://www.w3schools.com");
							});//end of done function
				});//end of click function
		});//end of document ready function
		var v = 0;
		function fun(){
			alert(++v);
			alert(links+"links");
		}
</script>
</head>
<body>
<a href="/index.html" class="project" target="content">project1</a>
<a href="/index.html" class="project" target="content">project2</a>
<input type="button" id="b1" value="submit">
<input type="button" id="b2" value="submit2">
<div id="body"></div>
<iframe src="" id="body1" name="content"></iframe>
</body>
</html>
